package com.itheima.d3_log;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/*
     目标：掌握LogBack日志框架的使用。
 */
public class LogBackTest {
    private static final Logger logger = LoggerFactory.getLogger("LogBackTest");

    public static void main(String[] args) {
        // 测试
        logger.trace("程序进入main方法.");
        test(9, 0);
    }

    public static void test(int num1, int num2) {
        logger.info("日志看看");
        if (num1 < 10) {
            logger.warn("参数已小于10");
        }

        try {
            int result = num1 / num2;
            logger.debug("result -> " + result);
        } catch (Exception e) {
            logger.error("异常: " + e.getMessage());
        }
    }
}
